import {createStore, applyMiddleware, compose} from 'redux'
import {createLogger} from "redux-logger";
import reducer from '../reducers'
import thunkMiddleware from "redux-thunk"

export const defaultStore = {
  // logo
  logo: {
    code: null,
    data: {
      H5Banner: null,
      H5Logo: null,
      recordNumber: null
    },
    msg: null
  },
  longRent: {
    list: null
  },
  shortRent: {
    list: null
  },
  meetingRoom: {
    list: null
  },
  site: {
    list: null
  },
  announcement: {
    list: null
  },
  themeModules: {
    data: null,
    modules:null,
  },
  demand: {
    data: null,
  },
  consulting: {
    data: null
  },
  roadShow: {
    data : null
  },
  serviceShow:{
    data:null
  },
  group:{
    data:null
  },
  enterpriseShow:{
    data:null
  },
  investShow:{
    data:null
  }
}

/* MIDDLEWARE */
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
const loggerMiddleware = createLogger();

/* CREATE STORE */
const store = createStore(reducer, defaultStore, composeEnhancers(applyMiddleware(loggerMiddleware, thunkMiddleware)));
export default store
